package org.testis.webautomationmodule.ui.objects;

import org.testis.logging.AtofLogLevel;
import org.testis.webautomationmodule.ui.UIBehaviorDecorator;


public class WaitForPageLoad extends UIBehaviorDecorator
{

    private String timeout;


    public WaitForPageLoad(String timeout)
    {
        setTimeout(timeout);
    }


    @Override
    protected boolean setBehavior()
    {
        try {
            getWebAutomationImpl().waitForPageToLoad(timeout);
            putLog(" passed waiting page to load with  timeout " + getTimeout(),AtofLogLevel.DEBUG);
        } catch (Exception ex) {
            putLog(" failed waiting page to load w with timeout " +
                   getTimeout(),AtofLogLevel.ERROR);
        }
        return true;

    }


    public String getTimeout()
    {
        return timeout;
    }


    public void setTimeout(String val)
    {
        this.timeout = val;
    }
}

